home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "Double-Click to Change Key State"
- ClientHeight = 675
- ClientLeft = 2220
- ClientTop = 3165
- ClientWidth = 5325
- Height = 1080
- KeyPreview = -1 'True
- Left = 2160
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 675
- ScaleWidth = 5325
- Top = 2820
- Width = 5445
- Begin Timer Timer1
- Interval = 250
- Left = 4800
- Top = 120
- End
- Begin Label Label3
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Num Lock:"
- Height = 195
- Index = 1
- Left = 2640
- TabIndex = 3
- Top = 240
- Width = 930
- End
- Begin Label Label3
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Caps Lock:"
- Height = 195
- Index = 0
- Left = 240
- TabIndex = 2
- Top = 240
- Width = 975
- End
- Begin Label Label2
- Alignment = 2 'Center
- BackColor = &H000000FF&
- BorderStyle = 1 'Fixed Single
- Caption = "Label2"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 330
- Left = 3720
- TabIndex = 1
- Top = 120
- Width = 885
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H000000FF&
- BorderStyle = 1 'Fixed Single
- Caption = "Label1"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 330
- Left = 1320
- TabIndex = 0
- Top = 120
- Width = 885
- End
- ' KeyState.Frm - Demo display of and setting Caps and Num Lock
- ' 95/01/22 Copyright 1995, Larry Rebich, The Bridge, Inc.
- ' See the text in KeyState.Bas for a description of this "workaround"
- Option Explicit
- DefInt A-Z
- Sub Form_KeyPress (KeyAscii As Integer)
- If KeyAscii = 27 Then End 'esc pressed
- End Sub
- Sub Form_Load ()
- Timer1_Timer 'get state right now
- 'Center Me is nicer
- Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2 * .85
- End Sub
- Sub Label1_DblClick ()
- SetKeyboardStateCapsLock 'toggle it
- End Sub
- Sub Label2_DblClick ()
- SetKeyboardStateNumLock 'toggle it
- End Sub
- Sub Timer1_Timer ()
- ' 95/01/22 Get the current setting every so often.
- Label1.Caption = GetKeyboardStateCapsLock()
- Label2.Caption = GetKeyboardStateNumLock()
- End Sub
-